package com.ruoyi.system.service.impl;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.domain.Meeting;
import com.ruoyi.system.mapper.MeetingMapper;
import com.ruoyi.system.service.IMeetingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * meetingService业务层处理
 * 
 * @author ruoyi
 * @date 2025-08-05
 */
@Service
public class MeetingServiceImpl implements IMeetingService 
{
    @Autowired
    private MeetingMapper meetingMapper;

    @Override
    public List<Map<String,Object>>  selectValid(String ppconferencefield, String ppconferencetitle, String ppconferenceaddress, String ppmeetingtime,
                                     String ppmeetingendtime,  int ppzhuangtai, String pppaixu, int ppStartIndex,  int ppPageSize) {
        return meetingMapper.selectValid(ppconferencefield, ppconferencetitle, ppconferenceaddress, ppmeetingtime, ppmeetingendtime, ppzhuangtai, pppaixu, ppStartIndex, ppPageSize);
    }

    @Override
    public int countValid(String ppconferencefield, String ppconferencetitle, String ppconferenceaddress, String ppmeetingtime,
                          String ppmeetingendtime,  int ppzhuangtai) {
        Object mmCount = meetingMapper.countValid(ppconferencefield, ppconferencetitle, ppconferenceaddress, ppmeetingtime, ppmeetingendtime, ppzhuangtai);
        return mmCount == null ? 0 : Integer.parseInt(mmCount.toString());
    }

    @Override
    public List<Meeting> selectAll(String ppconferencetitle, int ppStartIndex,  int ppPageSize) {
        return meetingMapper.selectAll(ppconferencetitle,ppStartIndex, ppPageSize);
    }

    @Override
    public int countAll(String ppconferencetitle) {
        Object mmCount = meetingMapper.countAll(ppconferencetitle);
        return mmCount == null ? 0 : Integer.parseInt(mmCount.toString());
    }

    @Override
    public int getMaxNumber() {
        Object mmCount = meetingMapper.getMaxNumber();
        return mmCount == null ? 0 : Integer.parseInt(mmCount.toString());
    }

    @Override
    public List<Map<String,Object>> selectMeetingaddress() {
        return meetingMapper.selectMeetingaddress();
    }

    @Override
    public List<Map<String,Object>> selectMeetingfield() {
        return meetingMapper.selectMeetingfield();
    }

    /**
     * 查询meeting
     * 
     * @param id meeting主键
     * @return meeting
     */
    @Override
    public Meeting selectMeetingById(String id)
    {
        return meetingMapper.selectMeetingById(id);
    }

    /**
     * 查询meeting列表
     * 
     * @param meeting meeting
     * @return meeting
     */
    @Override
    public List<Meeting> selectMeetingList(Meeting meeting)
    {
        return meetingMapper.selectMeetingList(meeting);
    }

    /**
     * 新增meeting
     * 
     * @param meeting meeting
     * @return 结果
     */
    @Override
    public int insertMeeting(Meeting meeting)
    {
        meeting.setCreateTime(DateUtils.getNowDate());
        return meetingMapper.insertMeeting(meeting);
    }

    /**
     * 修改meeting
     * 
     * @param meeting meeting
     * @return 结果
     */
    @Override
    public int updateMeeting(Meeting meeting)
    {
        meeting.setUpdateTime(DateUtils.getNowDate());
        return meetingMapper.updateMeeting(meeting);
    }

    /**
     * 批量删除meeting
     * 
     * @param ids 需要删除的meeting主键
     * @return 结果
     */
    @Override
    public int deleteMeetingByIds(String[] ids)
    {
        return meetingMapper.deleteMeetingByIds(ids);
    }

    /**
     * 删除meeting信息
     * 
     * @param id meeting主键
     * @return 结果
     */
    @Override
    public int deleteMeetingById(String id)
    {
        return meetingMapper.deleteMeetingById(id);
    }
}
